/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-05-02
 * Time: 19:20
 */
interface IRunning {
   void run();
}
class Animal {
    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }
    String name;
    int age;
    public void eat() {
        System.out.println("正在吃饭");
    }
}
class Dog extends Animal implements IRunning {

    public Dog(String name, int age) {
        super(name, age);
    }

    @Override
    public void run() {
        System.out.println(name+"正在跑！");
    }

    @Override
    public void eat() {
        System.out.println(name+"正在吃狗粮！");
    }
}
public class Test {
    public static void run(IRunning iRunning) {
        iRunning.run();
    }
    public static void eat(Animal animal) {
        animal.eat();
    }
    public static void main(String[] args) {
        Dog dog = new Dog("hello",6);
        run(dog);
        eat(dog);
    }
}
